﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing.plaf.basic.icon {
    import flash.display.*;
    import org.aswing.*;
    import flash.filters.*;
    import org.aswing.geom.*;
    import org.aswing.plaf.*;
    import org.aswing.graphics.*;
    import org.aswing.plaf.basic.*;

    public class FrameIcon implements Icon, UIResource {

        protected var width:int;
        protected var height:int;
        protected var box:Shape;
        protected var dot:Shape;
        private var sprite:Sprite;

        public function FrameIcon(_arg1:int=16){
            this.width = _arg1;
            this.height = _arg1;
            this.sprite = new Sprite();
            this.sprite.mouseChildren = false;
            this.sprite.mouseEnabled = false;
            this.box = new Shape();
            this.dot = new Shape();
            this.sprite.addChild(this.box);
            this.sprite.addChild(this.dot);
        }
        public function getColor(_arg1:Component):ASColor{
            return (_arg1.getMideground());
        }
        public function updateIcon(_arg1:Component, _arg2:Graphics2D, _arg3:int, _arg4:int):void{
            var _local8:StyleResult;
            this.box.graphics.clear();
            _arg2 = new Graphics2D(this.box.graphics);
            var _local5:AbstractButton = (_arg1 as AbstractButton);
            if (_local5 == null){
                return;
            };
            var _local6:IntRectangle = new IntRectangle(_arg3, _arg4, this.width, this.height);
            new IntRectangle(_arg3, _arg4, this.width, this.height).width = (_local6.width - 1);
            _local6.height = (_local6.height - 1);
            var _local7:ASColor = _arg1.getMideground();
            var _local9:StyleTune = _arg1.getStyleTune().mide;
            var _local10:ButtonModel = _local5.getModel();
            var _local11:Boolean = ((_local10.isArmed()) || (_local10.isSelected()));
            var _local12:Number = 1;
            if (!_local5.isEnabled()){
                _local7 = _local7.offsetHLS(0, -0.06, -0.03);
                _local9 = _local9.sharpen(0.4);
                _local8 = new StyleResult(_local7, _local9);
                BasicGraphicsUtils.fillGradientRoundRect(_arg2, _local6, _local8);
            } else {
                if (_local11){
                    _local9 = _local9.sharpen(0.8);
                    _local8 = new StyleResult(_local7, _local9);
                    BasicGraphicsUtils.fillGradientRoundRect(_arg2, _local6, _local8, (-(Math.PI) / 2));
                } else {
                    if (_local10.isRollOver()){
                        _local7 = _local7.offsetHLS(0, 0.06, 0);
                        _local8 = new StyleResult(_local7, _local9);
                        BasicGraphicsUtils.fillGradientRoundRect(_arg2, _local6, _local8);
                    } else {
                        _local8 = new StyleResult(_local7, _local9);
                        BasicGraphicsUtils.fillGradientRoundRect(_arg2, _local6, _local8);
                    };
                };
            };
            BasicGraphicsUtils.drawGradientRoundRectLine(_arg2, _local6, 1, _local8);
            this.box.filters = [new DropShadowFilter(1, 45, 0xFFFFFF, (_local8.shadow * _local12), 1, 1, 1, 1)];
            this.dot.graphics.clear();
            this.updateIconImp(_local8, new Graphics2D(this.dot.graphics), _arg3, _arg4);
        }
        public function updateIconImp(_arg1:StyleResult, _arg2:Graphics2D, _arg3:int, _arg4:int):void{
        }
        public function getSize():int{
            return (this.width);
        }
        public function getIconHeight(_arg1:Component):int{
            return (this.width);
        }
        public function getIconWidth(_arg1:Component):int{
            return (this.height);
        }
        public function getDisplay(_arg1:Component):DisplayObject{
            return (this.sprite);
        }

    }
}//package org.aswing.plaf.basic.icon 
